function getElementPath(element)
{
    return "//" + $(element).parents().andSelf().map(function() {
        var $this = $(this);
        var tagName = this.nodeName;
        if ($this.siblings(tagName).length > 0) {
            tagName += "[" + $this.prevAll(tagName).length + "]";
        }
        return tagName;
    }).get().join("/").toUpperCase();
}

$(function() {
    $("*:not(html, head, body)").hover( function () {
            $(this).css({
				"border" : "2px solid #FF6600",
				"border-radius": "3px",
				"background-color": "#FFCC99"
				});
	return false;
    }, 
    function () {
            $(this).css({
				"border": "none",
				"background-color": "transparent"
				});
    }).click( function () {
            alert(getElementPath(this));
            return false;
    });
});